package org.makcro.sms.services.chat.base.filters;

import java.text.MessageFormat;

import org.apache.log4j.Logger;
import org.makcro.sms.services.chat.model.Question;

/**
 * Default filter in the chain. Sets questino visible and stores it to db.
 * 
 * @author makcro
 * 
 */
public class DefaultFilterImpl extends AbstractFilter {

	/**
	 * Logger instance
	 */
	private Logger	logger	= Logger.getLogger( DefaultFilterImpl.class );

	@Override
	public boolean process(Question item) {
		item.setVisable( true );
		this.questionDAO.create( item );

		logger.debug( MessageFormat.format( "Saved question [{0}] to database", item.getQuestionID() ) );
		return true;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Default filter";
	}

	
}
